//import 'dart:convert' show json;

class PersonalPageModel {
    String id;
    String headImg;
    DateTime birthday;
    String username;
    int sex;

    PersonalPageModel({
      this.id,
      this.headImg,
      this.birthday,
      this.username,
      this.sex
    });

    factory PersonalPageModel.fromJson(Map<String, dynamic> json) => new PersonalPageModel(
        id: json["id"],
        headImg: json["headImg"],
        birthday: DateTime.parse(json["birthday"]),
        username: json["username"],
        sex: json["sex"]
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "headImg": headImg,
        "birthday": birthday.toIso8601String(),
        "username": username,
        "sex": sex
    };
}
